home *** CD-ROM | disk | FTP | other *** search
/ Aminet 33 / Aminet 33 - October 1999.iso / Aminet / dev / basic / AmosBlitz_src.lha / Sourcecodes / Offence.asc < prev    next >
Encoding:
Text File  |  1996-06-13  |  57.4 KB  |  1,748 lines

  1. Set Buffer 25
  2. Screen Open 0,320,200,4,Lowres : Curs Off 
  3. Close Workbench : Amos Lock 
  4. Hide 
  5. Cls 0
  6. If Ntsc=-1 Then PAL=0 Else PAL=1
  7. 'Close Editor  
  8. Dim X(64),Y(64)
  9. Dim NOM$(9),SCORE(9)
  10. Global NOM$(),SCORE()
  11. Dim F$(8),DIE$(4)
  12.  
  13. TITEL:
  14. Update On 
  15. Led Off 
  16. Load "titleTune"
  17. Music 1
  18. Break Off 
  19. Screen Open 0,320,200,32,Lowres
  20. Curs Off 
  21. Screen Open 1,320,200,2,Lowres
  22. Curs Off 
  23. Load "Title",0
  24. Unpack 0 To 0
  25. Paper 0 : Pen 15 : Locate 15,10 : Print "F1 Start"
  26. Locate 15,12 : Print "F2 Music+SFX"
  27. Locate 15,14 : Print "F3 PAL"
  28. Locate 15,16 : Print "F4 Hiscores"
  29. Locate 15,18 : Print "F5 Quit"
  30. Blit Store Left 1,1,0,104 To 320,111,-1
  31. Blit Store Left 1,2,0,122 To 320,129,1
  32. Reserve Stars 400
  33. For I=1 To 400
  34.    Define Star I,Rnd(319),I/2,Rnd(4)+1,0
  35. Next 
  36. Colour 1,$FFF
  37. Colour 9,$FF
  38. Stars Int On 1
  39. Set Rainbow 0,1,280,"","",""
  40. Rainbow 0,0,0,280
  41. Colour Back 0
  42. Restore RDATA
  43. For C=0 To 279 : Read CVA : Rain(0,C)=CVA
  44. Next C : View 
  45. RDATA:
  46. Data $A00,$A00,$FFF,$F0F,$0,$A00,$B60,$F00
  47. Data $FF0,$C0E,$8F0,$A00,$620,$F,$FF0,$FF0
  48. Data $CC,$F,$AF,$B60,$FF0,$F00,$FF0,$F
  49. Data $AF,$7C,$F00,$FF,$F,$CC,$D80,$620
  50. Data $F00,$AF,$FF,$FF0,$F,$F00,$B60,$FF
  51. Data $7C,$FF,$D80,$F00,$7C,$FF,$FF,$F
  52. Data $7C,$F,$C0E,$FF0,$C08,$7C,$D80,$F
  53. Data $C0E,$0,$FF0,$F0,$8F0,$7C,$F,$F
  54. Data $CC,$FF0,$CC,$F0F,$8F0,$C08,$80,$FFF
  55. Data $F0,$C08,$7C,$F0F,$F,$C0E,$70F,$AF
  56. Data $8F0,$F0,$8F0,$F0,$CC,$F0F,$F,$C08
  57. Data $C0E,$AF,$F0,$70F,$F,$F0,$C08,$7C
  58. Data $F0F,$7C,$F,$B60,$F00,$CC,$CC,$70F
  59. Data $F00,$8F0,$B60,$70F,$C08,$A00,$F00,$70F
  60. Data $620,$CC,$620,$FF,$F00,$0,$80,$A00
  61. Data $D80,$F00,$FF,$A00,$70F,$80,$B60,$D80
  62. Data $F00,$620,$80,$70F,$F00,$FFF,$D80,$A00
  63. Data $D80,$620,$D80,$FFF,$AF,$B60,$FFF,$FFF
  64. Data $A00,$A00,$D80,$7C,$FF0,$FFF,$B60,$A00
  65. Data $FFF,$FF0,$FFF,$D80,$A00,$F0,$F0F,$FFF
  66. Data $CC,$AF,$F0F,$AF,$D80,$0,$F0,$C0E
  67. Data $0,$C08,$8F0,$8F0,$FF,$0,$0,$B60
  68. Data $8F0,$7C,$C08,$F,$8F0,$80,$80,$0
  69. Data $80,$CC,$C08,$80,$620,$620,$B60,$620
  70. Data $B60,$FFF,$FFF,$B60,$620,$FF,$CC,$0
  71. Data $80,$CC,$620,$CC,$620,$CC,$70F,$C08
  72. Data $F00,$C08,$C08,$C0E,$C0E,$AF,$C0E,$C08
  73. Data $C0E,$AF,$F,$C08,$7C,$AF,$C0E,$CC
  74. Data $C0E,$C0E,$7C,$70F,$70F,$D80,$D80,$FF0
  75. Data $D80,$A00,$A00,$0,$0,$0,$0,$0
  76. Data $0,$0,$0,$0,$0,$0,$0,$0
  77. Data $0,$0,$0,$0,$0,$0,$0,$0
  78. Data $0,$0,$0,$0,$0,$0,$0,$0
  79. Data $0,$0,$0,$0,$0,$0,$0,$0
  80. Data $0,$0,$0,$0,$0,$0,$0,$0
  81. Data $0,$0,$0,$0,$0,$0,$0,$0
  82. Blit Int On 1 To 2
  83. Multi No 
  84. Get Palette 0
  85. PAL=1
  86. Do 
  87.    A$=Inkey$
  88.    If Key State(80) Then Goto ANF
  89.    If Key State(81) and SFX=0 Then Locate 15,12 : Print "F2 Sound-FX " : SFX=1 : Wait 10
  90.    If Key State(81) and SFX=1 Then Locate 15,12 : Print "F2 Music+SFX" : SFX=0 : Wait 10
  91.    If Key State(82) and PAL=1 Then Locate 15,14 : Print "F3 NTSC" : Doke $DFF1DC,0 : PAL=0 : Wait 10
  92.    If Key State(82) and PAL=0 Then Locate 15,14 : Print "F3 PAL " : Doke $DFF1DC,32 : PAL=1 : Wait 10
  93.    If Key State(83) Then HISCORE_LOAD["Hiscores"] : TITELHI
  94.    If Key State(84) Then INDE
  95.    If A$="c"
  96.       I$=Input$(7)
  97.       If I$="heat on" : Boom : CHET=1 : End If 
  98.    End If 
  99.    If A$="u"
  100.       I$=Input$(8)
  101.       If I$="nlimited" : Shoot : LIVE=1 : End If 
  102.    End If 
  103.    If A$="o"
  104.       I$=Input$(2)
  105.       If I$="ff" : Boom : Wait 10 : Boom : CHET=0 : End If 
  106.    End If 
  107.    If A$="l"
  108.       I$=Input$(6)
  109.       If I$="imited" : Shoot : Wait 10 : Shoot : LIVE=0 : End If 
  110.    End If 
  111. Loop 
  112.  
  113. Procedure INDE
  114. Multi Yes 
  115. Stars Int Off 
  116. Blit Int Off 
  117. Stars Erase 
  118. Blit Erase 1
  119. Blit Erase 2
  120. End 
  121. End Proc
  122.  
  123. ANF:
  124. Multi Yes 
  125. Stars Int Off 
  126. Blit Int Off 
  127. Stars Erase 
  128. Blit Erase 1
  129. Blit Erase 2
  130.  
  131. 'Break On  
  132.  
  133. Rainbow Del 
  134. Screen Close 0
  135. For X=60 To 0 Step -2
  136.    Mvolume X
  137.    Wait 2
  138. Next 
  139. Music Stop : Wait 5
  140. Mvolume 63
  141.  
  142. 'Close Editor  
  143.  
  144. Led Off 
  145. Screen Open 0,320,200,32,Lowres
  146. Colour 1,$0 : Curs Off : Flash Off : Hide 
  147. Fade 1,$0 : Wait 15
  148. Load "Sprites"
  149. Get Sprite Palette : Colour 1,$0
  150. Bob 3,60,75,3
  151.  
  152. FRANK:
  153.  
  154. Screen Close 0
  155. 'Close Editor  
  156.  
  157. If SFX=1 Then Music Stop 
  158. If SFX=0 Then Load "GameMusic"
  159. If SFX=0 Then Music 1
  160.  
  161. Global F$(),LAUNCHED,LIVES,FIN_LEVEL,CHEAT,LEVEL,SCORE,BULLETS
  162.  
  163. 'score screen
  164. '
  165. Load "Samples"
  166. Screen Open 5,320,31,16,Lowres : Double Buffer : Curs Off : Hide : Flash Off : Get Sprite Palette : Colour 1,$0
  167. Screen Display 5,,211,,
  168. 'Paste Bob 0,0,64
  169. Set Rainbow 1,2,16,"","(1,2,7)(1,-2,7)",""
  170. Rainbow 1,0,218,15
  171. Autoback 0
  172. Hide On 
  173.  
  174. Screen Open 2,320,160,32,Lowres
  175. Autoback 0
  176. Flash Off 
  177. Curs Off 
  178. Cls 0
  179. Double Buffer 
  180. Hide On 
  181. '
  182. ' Hauptprogramm: 
  183. Repeat 
  184.    If LIVE=1 Then LIVES=99 Else LIVES=5
  185.    LAUNCHED=1
  186.    BULLETS=1
  187.    LEVEL=0
  188.    If CHET=1 Then CHEAT=1 Else CHEAT=0
  189.    SCORE=0
  190.    FIN_LEVEL=True
  191.    Amreg(9)=SCORE
  192.    Amreg(20)=BULLETS
  193.    '
  194.    While FIN_LEVEL=True and LEVEL<6
  195.       If FIN_LEVEL=True
  196.          Inc LEVEL
  197.          LAUNCHED=1
  198.          SCRLSPEED=1
  199.          If LEVEL mod 2=0 and DEUTSCH=0
  200.             VERT_MAIN_LOOP
  201.          Else If DEUTSCH=0
  202.             HORIZ_MAIN_LOOP
  203.          End If 
  204.       End If 
  205.    Wend 
  206.    '
  207.    FINISH_MESSAGE
  208.    Rainbow Del : Goto TITEL
  209. Until False
  210. End 
  211.  
  212. Procedure FIN_WAIT
  213.    Clear Key 
  214.    While(Mouse Key=0) and(Joy(1)=0) and(Inkey$="")
  215.    Wend 
  216. End Proc
  217. Procedure FINISH_MESSAGE
  218.    Screen 2 : Amal Off : Sprite Off 
  219.    Fade 3,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0
  220.    Wait 35
  221.    Cls 0
  222.    Update 
  223.    Screen 5
  224.    Fade 2,$0,$0
  225.    Wait 35
  226.    Cls 0
  227.    Update 
  228.    Screen 2
  229.    Colour 4,$B
  230.    Colour 7,$ADF
  231.    Gr Writing 0
  232.    Ink 3
  233.    Ink 4 : Text 120,80,"GAME OVER"
  234.    For X=63 To 0 Step -2
  235.       Mvolume X
  236.       Wait 2
  237.    Next 
  238.    Music Stop 
  239.    Wait 5
  240.    Volume 63
  241.    Wait 10
  242.    Sam Play 1,3
  243.    Wait 25
  244.    Screen 5
  245.    Colour 1,$FFF
  246.    Wait 5
  247.    If FIN_LEVEL=False
  248.       HISCORE_LOAD["Hiscores"]
  249.       HISCORE_ENTER[SCORE]
  250.       HISCORE_SAVE["Hiscores"]
  251.       Wait Key 
  252.       HISCORE_REMOVE
  253.    Else 
  254.       Set Rainbow 0,1,290,"","","" : Screen Open 0,640,1000,2,Hires : Palette 0,0
  255.       Flash Off : Curs Off : Rainbow 0,0,0,290
  256.       C1DAT:
  257.       Data $0,$111,$222,$333,$444,$555,$666,$777,$888,$999,$AAA,$BBB,$CCC,$DDD,$EEE,$FFF
  258.       Restore C1DAT : For F=0 To 31 Step 2 : Read CD : Rain(0,F)=CD : Rain(0,F+1)=CD : Next F : For F=31 To 261 : Rain(0,F)=$FFF : Next F
  259.       Restore C1DAT : For F=230 To 261 Step 2 : Read CD : Rain(0,F)=$FFF-CD : Rain(0,F+1)=$FFF-CD : Next F
  260.       Print S$
  261.       Screen Open 0,640,290,2,Hires : Curs Off : Hide 
  262.       Screen Display 0,,28,, : Palette $0,$FFF
  263.       
  264.       Load "EndPic",0 : Unpack 0 To 0
  265.       While Fire(1)=0 : Wend 
  266.       Fade 2 : Wait 30
  267.       End 
  268.    End If 
  269.    Cls 0
  270. End Proc
  271. Procedure CLEAR_AMAL
  272.    SCORE=Amreg(9)
  273.    BULLETS=Amreg(20)
  274.    '
  275.    For LOP=0 To 25
  276.       Amreg(LOP)=0
  277.    Next LOP
  278.    For LOP=1 To 8
  279.       Amreg(LOP)=100
  280.    Next LOP
  281.    '
  282.    ' Score!   
  283.    '
  284.    Amreg(9)=SCORE
  285.    '  
  286.    ' Amount of bullets
  287.    '
  288.    Amreg(20)=BULLETS
  289. End Proc
  290. Procedure LEVEL1
  291.    '
  292.    '   Fade 5,$F : Wait 75
  293.    Load "Level1",0 : Unpack 0 To 1
  294.    
  295.    '
  296.    
  297.    Screen Hide 1
  298.    Screen Display 1,128,-10,320,160
  299.    Hide On 
  300.    '   Fade 1,$F
  301.    Set Rainbow 3,0,60,"(4,1,20)","",""
  302.    Rainbow 3,0,150,60
  303.    '  
  304.    For LOP=0 To 15
  305.       Colour LOP+16,Colour(LOP)
  306.    Next LOP
  307.    Wait Vbl 
  308.    Autoback 0
  309.    Synchro Off : Update Off 
  310.    '
  311.    '
  312.    '
  313.    '
  314.    ' Missile 1(unten -oben) 
  315.    '   Channel 20 To Bob 20 
  316.    '   Bob 30,240,0,14
  317.    '   Bob 31,240,144,15
  318.    '   Bob 20,243,145,16
  319.    '
  320.    '   M$="   Begin:  AUtotest(If BC(20,1,8) Jump Next       ;" 
  321.    '   M$=M$+"        eXit ;   Next: Direct Finish)          ;" 
  322.    '   M$=M$+"        Let X=243                              ;" 
  323.    '   M$=M$+"        Let Y=165                              ;" 
  324.    '   M$=M$+"        Move 0,-144,24 ; Let R1=5 ; Jump Delay ;" 
  325.    '   M$=M$+"Finish: Let X=243 ; Let Y=145 ; Let R1=20      ;" 
  326.    '   M$=M$+"        Let RJ=RJ+10                           ;" 
  327.    '   M$=M$+"Delay: For R0=1 To R1 ; P ; P ; Next R0 ; Jump Begin  ;"
  328.    '   Amal 20,M$ 
  329.    '
  330.    'stalakmit 
  331.    Channel 21 To Bob 21
  332.    Bob 21,546,0,27
  333.    M2$="    Begin:  Let R0=X-20                                ;"
  334.    M2$=M2$+"         If XS(1,RX)+RN<R0 Jump Begin               ;"
  335.    M2$=M2$+"         Move 0,260,20                              ;"
  336.    Amal 21,M2$
  337.    'stalak ##2 !!!! 
  338.    Channel 32 To Bob 32
  339.    Bob 32,746,0,27
  340.    M2$="    Begin:  Let R0=X-20                                ;"
  341.    M2$=M2$+"         If XS(1,RX)+RN<R0 Jump Begin               ;"
  342.    M2$=M2$+"         Move 0,260,20                              ;"
  343.    Amal 32,M2$
  344.    '
  345.    Paste Bob 576,140,36
  346.    Paste Bob 448,0,37
  347.    Paste Bob 609,0,37
  348.    '
  349.    For L=23 To 25
  350.       Channel L To Bob L
  351.       Bob L,576+4,0,34
  352.       M3$="     Begin: Let X=579 ; Let Y=136                            ;"
  353.       M3$=M3$+"        If RN<250 Jump Begin                             ;"
  354.       M3$=M3$+"        Let R2=Z(80+"+Str$(L)+")                         ;"
  355.       M3$=M3$+"        If R2>0 Jump Begin                               ;"
  356.       M3$=M3$+"        AUtotest(If BC("+Str$(L)+",1,8) Jump Next        ;"
  357.       M3$=M3$+"        eXit ;   Next: Direct Finish)                    ;"
  358.       M3$=M3$+"        Let R0=XS(2,RX)+RN ; Let R1=YS(2,RW)             ;"
  359.       M3$=M3$+"        Move R0-X,R1-Y,Z(10)+12                          ;"
  360.       M3$=M3$+"Finish: Let X=579 ; Let Y=136                            ;"
  361.       M3$=M3$+"        For R3=1 To Z(10)+5 ; P ; Next R3                ;"
  362.       M3$=M3$+"        Let RJ=RJ+10                                     ;"
  363.       M3$=M3$+"        If RN<570 Jump Begin                             ;"
  364.       '
  365.       Amal L,M3$
  366.    Next L
  367.    For L=26 To 26
  368.       Channel L To Bob L
  369.       Bob L,448+4,0,34
  370.       M3$="     Begin: Let X=449 ; Let Y=11                             ;"
  371.       M3$=M3$+"        If RN<142 Jump Begin                             ;"
  372.       M3$=M3$+"        Let R2=Z(80+"+Str$(L)+")                         ;"
  373.       M3$=M3$+"        If R2>0 Jump Begin                               ;"
  374.       M3$=M3$+"        AUtotest(If BC("+Str$(L)+",1,8) Jump Next        ;"
  375.       M3$=M3$+"        eXit ;   Next: Direct Finish)                    ;"
  376.       M3$=M3$+"        Let R0=XS(2,RX)+RN ; Let R1=YS(2,RW)             ;"
  377.       M3$=M3$+"        Move R0-X,R1-Y,Z(10)+12                          ;"
  378.       M3$=M3$+"Finish: Let X=449 ; Let Y=11                             ;"
  379.       M3$=M3$+"        For R3=1 To Z(10)+5 ; P ; Next R3                 ;"
  380.       M3$=M3$+"        Let RJ=RJ+10                                     ;"
  381.       M3$=M3$+"        If RN<462 Jump Begin                             ;"
  382.       '
  383.       Amal L,M3$
  384.    Next L
  385.    '
  386.    For L=27 To 27
  387.       Channel L To Bob L
  388.       Bob L,609+4,256,34
  389.       M3$="     Begin: Let X=609+1 ; Let Y=11                           ;"
  390.       M3$=M3$+"        If RN<300 Jump Begin                             ;"
  391.       M3$=M3$+"        Let R2=Z(80+"+Str$(L)+")                         ;"
  392.       M3$=M3$+"        If R2>0 Jump Begin                               ;"
  393.       M3$=M3$+"        AUtotest(If BC("+Str$(L)+",1,8) Jump Next        ;"
  394.       M3$=M3$+"        eXit ;   Next: Direct Finish)                    ;"
  395.       M3$=M3$+"        Let R0=XS(2,RX)+RN ; Let R1=YS(2,RW)             ;"
  396.       M3$=M3$+"        Move R0-X,R1-Y,Z(10)+12                          ;"
  397.       M3$=M3$+"Finish: Let X=609+1 ; Let Y=11                            ;"
  398.       M3$=M3$+"        For R3=1 To Z(10)+5 ; P ; Next R3                ;"
  399.       M3$=M3$+"        Let RJ=RJ+10                                     ;"
  400.       M3$=M3$+"        If RN<634 Jump Begin                             ;"
  401.       '
  402.       Amal L,M3$
  403.    Next L
  404.    '
  405.    Channel 39 To Bob 39
  406.    Bob 39,571,80,35
  407.    M$="   Begin:  P ; If BC(39,1,8) Jump Finish          ;"
  408.    M$=M$+"        Jump Begin                             ;"
  409.    M$=M$+"Finish: Let Y=-50                              ;"
  410.    M$=M$+"        If RU>7 Jump Seeya                     ;"
  411.    M$=M$+"        Let RU=RU+2                            ;"
  412.    M$=M$+"Seeya:  Let RJ=RJ+1000  ; P                    ;"
  413.    Amal 39,M$
  414.    ' Docking area!
  415.    
  416.    Reserve Zone 1
  417.    
  418.    Set Zone 1,640,0 To 960,256
  419.    
  420.    
  421.    '
  422.    Wait Vbl 
  423. End Proc
  424. Procedure LEVEL2
  425.    
  426.    Load "Level2",0 : Unpack 0 To 1
  427.    Screen Hide 1
  428.    Screen Display 1,128,50,320,160
  429.    Set Rainbow 3,0,60,"(4,1,20)","",""
  430.    Rainbow 3,0,150,60
  431.    Channel 9 To Rainbow 3
  432.    
  433.    Hide On 
  434.    '  
  435.    For LOP=0 To 15
  436.       Colour LOP+16,Colour(LOP)
  437.    Next LOP
  438.    Wait Vbl 
  439.    Autoback 0
  440.    Synchro Off : Update Off 
  441.    Amal 9,"Move 0,-300,300"
  442.    Amal On 
  443.    ' MISSILES 
  444.    Wait Vbl 
  445.    For L=20 To 23
  446.       Channel L To Bob L
  447.    Next L
  448.    
  449.    '   Bob 20,270,310,26
  450.    '   Bob 21,290,330,26
  451.    Paste Bob 0,320,42
  452.    '
  453.    '
  454.    For L=24 To 29
  455.       Channel L To Bob L
  456.       Bob L,9,323,34
  457.       M$="     Begin: Let X=9 ; Let Y=323                            ;"
  458.       M$=M$+"        If RN<250 Jump Begin                              ;"
  459.       M$=M$+"        Let R2=Z(80+"+Str$(L)+")                         ;"
  460.       M$=M$+"        If R2>0 Jump Begin                               ;"
  461.       M$=M$+"        If Z(120)>0 Jump Begin                           ;"
  462.       M$=M$+"        AUtotest(If BC("+Str$(L)+",1,8) Jump Next        ;"
  463.       M$=M$+"        eXit ;   Next: Direct Finish)                    ;"
  464.       M$=M$+"        Let R0=XS(2,RX) ; Let R1=YS(2,RW)+RN             ;"
  465.       M$=M$+"        Move R0-X,R1-Y,Z(10)+10                        ;"
  466.       M$=M$+"Finish: Let X=9 ; Let Y=323                             ;"
  467.       M$=M$+"        For R3=1 To Z(10)+5 ; P ; Next R3                ;"
  468.       M$=M$+"        Let RJ=RJ+10                                     ;"
  469.       M$=M$+"        If RN<570 Jump Begin                             ;"
  470.       '
  471.       '
  472.       '     M3$="     Begin: Let X=579 ; Let Y=216                            ;" 
  473.       '      M3$=M3$+"        If RN<250 Jump Begin                             ;"
  474.       '      M3$=M3$+"        Let R2=Z(80+"+Str$(L)+")                         ;"
  475.       '      M3$=M3$+"        If R2>0 Jump Begin                               ;"
  476.       '      M3$=M3$+"        AUtotest(If BC("+Str$(L)+",1,8) Jump Next        ;"
  477.       '      M3$=M3$+"        eXit ;   Next: Direct Finish)                    ;"
  478.       '      M3$=M3$+"        Let R0=XS(2,RX)+RN ; Let R1=YS(2,RW)             ;"
  479.       '      M3$=M3$+"        Move R0-X,R1-Y,Z(10)+12                          ;"
  480.       '      M3$=M3$+"Finish: Let X=579 ; Let Y=216                            ;"
  481.       '      M3$=M3$+"        For R3=1 To Z(10)+5 ; P ; Next R3                ;"
  482.       '      M3$=M3$+"        Let RJ=RJ+10                                     ;"
  483.       '      M3$=M3$+"        If RN<570 Jump Begin    "
  484.       
  485.       '
  486.       Amal L,M$
  487.    Next L
  488.    '
  489.    Channel 31 To Bob 31
  490.    Bob 31,70,475,35
  491.    M$="   Begin:  P ; If BC(31,1,8) Jump Finish          ;"
  492.    M$=M$+"        Jump Begin                             ;"
  493.    M$=M$+"Finish: Let Y=-50                              ;"
  494.    M$=M$+"        If RU>7 Jump Seeya                     ;"
  495.    M$=M$+"        Let RU=RU+2                            ;"
  496.    M$=M$+"Seeya:  Let RJ=RJ+1000  ; P                    ;"
  497.    Amal 31,M$
  498.    '
  499.    ' Missile 1(unten -oben) 
  500.    Channel 36 To Bob 36
  501.    Channel 39 To Bob 39
  502.    Bob 36,330,500,16
  503.    Bob 39,-10,400,16
  504.    '
  505.    M$="   Begin:  AUtotest(If BC(20,1,8) Jump Next       ;"
  506.    M$=M$+"        eXit ;   Next: Direct Finish)          ;"
  507.    M$=M$+"        Let X=-10                              ;"
  508.    M$=M$+"        Let Y=400                              ;"
  509.    M$=M$+"        Move 330,0,24 ; Let R1=5 ; Jump Begin ;"
  510.    M$=M$+"Finish: Let X=-10 ; Let Y=400 ; Let R1=20      ;"
  511.    M$=M$+"        Let RJ=RJ+10                           ;"
  512.    Amal 39,M$
  513.    '
  514.    Q$="   Begin:  AUtotest(If BC(20,1,8) Jump Next       ;"
  515.    Q$=Q$+"        eXit ;   Next: Direct Finish)          ;"
  516.    Q$=Q$+"        Let X=330                              ;"
  517.    Q$=Q$+"        Let Y=500                              ;"
  518.    Q$=Q$+"        Move -340,0,24 ; Let R1=5 ; Jump Begin ;"
  519.    Q$=Q$+"Finish: Let X=330 ; Let Y=500 ; Let R1=20      ;"
  520.    Q$=Q$+"        Let RJ=RJ+10                           ;"
  521.    Amal 36,Q$
  522.    '
  523.    '
  524.    
  525.    Reserve Zone 1
  526.    Set Zone 1,0,481 To 320,736
  527.    '
  528. End Proc
  529. Procedure LEVEL3
  530.    '
  531.    '
  532.    
  533.    Fade 5,$0,$0,$0,$10,$30,$50
  534.    Load "Level3",0 : Unpack 0 To 1
  535.    
  536.    
  537.    '
  538.    Screen Hide 1
  539.    Screen Display 1,128,50,320,160
  540.    '
  541.    ' Make sure the image of the previous docking area is pasted in the  
  542.    ' correct position 
  543.    '
  544.    
  545.    Hide On 
  546.    '  
  547.    For LOP=0 To 15
  548.       Colour LOP+16,Colour(LOP)
  549.    Next LOP
  550.    Wait Vbl 
  551.    Autoback 0
  552.    Synchro Off : Update Off 
  553.    '
  554.    Wait Vbl 
  555.    
  556.    ' MISSILES 
  557.    For L=20 To 39
  558.       Channel L To Bob L
  559.    Next L
  560.    '
  561.    ' Missiles (indestructable)  
  562.    '
  563.    Bob 37,351,142,44 : Rem 101!!! 
  564.    Bob 38,399,142,44
  565.    For L=37 To 38
  566.       M$="    Begin:                                                  ;"
  567.       M$=M$+"         Let R2=Z(10)+30                                 ;"
  568.       M$=M$+"         Let R0=X-R2 ; P                                 ;"
  569.       M$=M$+"         If XS(1,RX)+RN<R0 Jump Begin                    ;"
  570.       M$=M$+"         Let R3=Z(10)+250                                ;"
  571.       M$=M$+"         Move -50,0-R3,10                                ;"
  572.       '      M$=M$+"         Let A=45                                       ;" 
  573.       '      M$=M$+"         Move 0,-150,0                                  ;" 
  574.       '      M$=M$+"Finish:  Let Y=-50                                      ;" 
  575.       Amal L,M$
  576.    Next L
  577.    '
  578.    ' Missile (shootable!) 
  579.    '
  580.    Bob 39,600,140,38
  581.    M$="    Begin:  AUtotest(If BC(39,1,8) Jump Next       ;"
  582.    M$=M$+"         eXit ;   Next: Direct Finish)                   ;"
  583.    M$=M$+"         Let R2=Z(10)+30                                 ;"
  584.    M$=M$+"         Let R0=X-R2 ; P                                 ;"
  585.    M$=M$+"         If XS(1,RX)+RN<R0 Jump Begin                    ;"
  586.    M$=M$+"         Let R3=Z(5)+200                                 ;"
  587.    M$=M$+"         Move -5,-5,100                              ;"
  588.    M$=M$+"         Let A=38                                        ;"
  589.    M$=M$+"         Move 300,-10,20;M -300,-10,20;M 300,10,20;M -400,-10,50;"
  590.    M$=M$+"Finish:  Let Y=-50                                       ;"
  591.    Amal 39,M$
  592.    '
  593.    ' Stalactites
  594.    '
  595.    Bob 25,465,0,27
  596.    Bob 26,485,0,27
  597.    Bob 27,505,0,27
  598.    Bob 28,525,0,27
  599.    Bob 29,545,0,27
  600.    Bob 30,565,0,27
  601.    Bob 31,585,0,27
  602.    Bob 32,605,0,27
  603.    Bob 33,625,0,27
  604.    Bob 34,645,0,27
  605.    Bob 35,665,0,27
  606.    Bob 36,685,0,27
  607.    '
  608.    For L=25 To 36
  609.       M$="    Begin:  Let R0=X-25 ; P ;                         ;"
  610.       M$=M$+"         If XS(1,RX)+RN<R0 Jump Begin              ;"
  611.       M$=M$+"         If YS(1,RW)<Y Jump Begin"
  612.       M$=M$+"         Move 0,280,10                             ;"
  613.       Amal L,M$
  614.    Next L
  615.    '
  616.    '
  617.    ' Docking area 
  618.    
  619.    Reserve Zone 1
  620.    Set Zone 1,640,0 To 960,256
  621.    '
  622.    Wait Vbl 
  623. End Proc
  624. Procedure LEVEL4
  625.    '
  626.    Load "Level4",0 : Unpack 0 To 1
  627.    Screen Hide 1
  628.    '
  629.    ' Make sure the image of the previous docking area is pasted in the  
  630.    ' correct position 
  631.    '
  632.    Screen Display 1,128,50,320,160
  633.    Hide On 
  634.    '  
  635.    For LOP=0 To 15
  636.       Colour LOP+16,Colour(LOP)
  637.    Next LOP
  638.    Wait Vbl 
  639.    Autoback 0
  640.    Synchro Off : Update Off 
  641.    Wait Vbl 
  642.    '
  643.    For L=20 To 23
  644.       Channel L To Bob L
  645.    Next L
  646.    Fade 10,$0
  647.    Bob 20,80,450,26
  648.    Bob 21,80,470,26
  649.    Bob 22,80,490,26
  650.    Bob 23,80,510,26
  651.    Paste Bob 0,320,42
  652.    '
  653.    For L=20 To 23
  654.       M$="   Begin:  If BC("+Str$(L)+",1,8) Jump Finish     ;"
  655.       M$=M$+"        P ; Jump Begin                         ;"
  656.       M$=M$+"Finish: Let X=340                              ;"
  657.       M$=M$+"        Let RJ=RJ+50                           ;"
  658.       Amal L,M$
  659.    Next L
  660.    '
  661.    '
  662.    For L=24 To 29
  663.       Channel L To Bob L
  664.       Bob L,9,323,34
  665.       M$="     Begin: Let X=9 ; Let Y=323                            ;"
  666.       M$=M$+"        If RN<100 Jump Begin                              ;"
  667.       M$=M$+"        Let R2=Z(80+"+Str$(L)+")                         ;"
  668.       M$=M$+"        If R2>0 Jump Begin                               ;"
  669.       M$=M$+"        If Z(120)>0 Jump Begin                           ;"
  670.       M$=M$+"        AUtotest(If BC("+Str$(L)+",1,8) Jump Next        ;"
  671.       M$=M$+"        eXit ;   Next: Direct Finish)                    ;"
  672.       M$=M$+"        Let R0=XS(2,RX) ; Let R1=YS(2,RW)+RN             ;"
  673.       M$=M$+"        Move R0-X,R1-Y,Z(10)+10                          ;"
  674.       M$=M$+"Finish: Let X=9 ; Let Y=323                             ;"
  675.       M$=M$+"        For R3=1 To Z(10)+5 ; P ; Next R3                ;"
  676.       M$=M$+"        Let RJ=RJ+10                                     ;"
  677.       M$=M$+"        If RN<260 Jump Begin                             ;"
  678.       Amal L,M$
  679.    Next L
  680.    '
  681.    Channel 31 To Bob 31
  682.    Bob 31,280,420,35
  683.    M$="   Begin:  P ; If BC(31,1,8) Jump Finish          ;"
  684.    M$=M$+"        Jump Begin                             ;"
  685.    M$=M$+"Finish: Let Y=-50                              ;"
  686.    M$=M$+"        If RU>7 Jump Seeya                     ;"
  687.    M$=M$+"        Let RU=RU+2                            ;"
  688.    M$=M$+"Seeya:  Let RJ=RJ+1000  ; P                    ;"
  689.    Amal 31,M$
  690.    '
  691.    
  692.    '
  693.    Channel 39 To Bob 39
  694.    Bob 39,802,117,35
  695.    M$="   Begin:  P ; If BC(39,1,8) Jump Finish          ;"
  696.    M$=M$+"        Jump Begin                             ;"
  697.    M$=M$+"Finish: Let Y=-50                              ;"
  698.    M$=M$+"        If RU>7 Jump Seeya                     ;"
  699.    M$=M$+"        Let RU=RU+2                            ;"
  700.    M$=M$+"Seeya:  Let RJ=RJ+1000  ; P                    ;"
  701.    Amal 39,M$
  702.    
  703.    '
  704.    '   Paste Bob 65,550,24
  705.    Reserve Zone 1
  706.    Set Zone 1,65,550 To 65+32,550+24
  707.    '
  708. End Proc
  709. Procedure LEVEL5
  710.    '
  711.    
  712.    Fade 2
  713.    Load "Level5",0 : Unpack 0 To 1
  714.    '
  715.    Screen Hide 1
  716.    Screen Display 1,128,50,320,160
  717.    Set Rainbow 2,0,65,"(4,-1,15)","(4,-1,15)","(4,-1,15)"
  718.    Rainbow 2,0,47,65
  719.    Set Rainbow 3,0,65,"(4,1,15)","(4,1,15)","(4,1,15)"
  720.    Rainbow 3,0,146,65
  721.    '
  722.    ' Make sure the image of the previous docking area is pasted in the  
  723.    ' correct position 
  724.    '
  725.    
  726.    Hide On 
  727.    '  
  728.    For LOP=0 To 15
  729.       Colour LOP+16,Colour(LOP)
  730.    Next LOP
  731.    Wait Vbl 
  732.    Autoback 0
  733.    Synchro Off : Update Off 
  734.    '
  735.    For L=20 To 29
  736.       Channel L To Bob L
  737.       M$="    Begin:  AUtotest(If BC("+Str$(L)+",1,8) Jump Next       ;"
  738.       M$=M$+"         eXit ;   Next: Direct Finish)                   ;"
  739.       M$=M$+"         For R0=0 To Z(3) ; P ; Next R0                  ;"
  740.       M$=M$+"         Let X=970                                       ;"
  741.       M$=M$+"         Let Y=Z(100)+10 ; Let R1=Z(50)+40               ;"
  742.       M$=M$+"         A 0,(12,3)(55,3)(56,3)(57,3);Move -980,0,R1     ;"
  743.       M$=M$+"         If RN<630 Jump Begin                             ;"
  744.       M$=M$+" Finish: Let X=700 ; Let Y=-50                           ; "
  745.       M$=M$+"         Let RJ=RJ+10                                    ;"
  746.       M$=M$+"         If RN<630 Jump Begin                            ;"
  747.       M$=M$+" Seeya:  Let Y=-50                                       ;"
  748.       Bob L,650,-50,12
  749.       Amal L,M$
  750.    Next L
  751.    '
  752.    ' Missiles 
  753.    '
  754.    Bob 30,370,136,44
  755.    Bob 31,630,139,44
  756.    Bob 32,439,139,44
  757.    
  758.    
  759.    '
  760.    For L=30 To 32
  761.       Channel L To Bob L
  762.       M$="    Begin:  AUtotest(If BC("+Str$(L)+",1,8) Jump Next       ;"
  763.       M$=M$+"         eXit ;   Next: Direct Finish)                   ;"
  764.       M$=M$+"         Let R2=Z(10)+50                                 ;"
  765.       M$=M$+"         Let R0=X-R2 ; P                                 ;"
  766.       M$=M$+"         If XS(1,RX)+RN<R0 Jump Begin                    ;"
  767.       M$=M$+"         Let R3=Z(20)+20                                 ;"
  768.       M$=M$+"         Move -150,-150,20                               ;"
  769.       M$=M$+"         Let A=45                                        ;"
  770.       '      M$=M$+"         Move -150,-150,20                               ;"
  771.       M$=M$+"Finish:  Let Y=-50                                       ;"
  772.       Amal L,M$
  773.    Next L
  774.    '
  775.    ' Docking area 
  776.    Reserve Zone 1
  777.    Set Zone 1,640,0 To 960,256
  778.    '
  779.    Wait Vbl 
  780. End Proc
  781. Procedure LEVEL6
  782.    '
  783.    Load "Level6",0 : Unpack 0 To 1
  784.    Screen Hide 1
  785.    '
  786.    ' Make sure the image of the previous docking area is pasted in the  
  787.    ' correct position 
  788.    '
  789.    Screen Display 1,128,50,320,160
  790.    Hide On 
  791.    '  
  792.    For LOP=0 To 15
  793.       Colour LOP+16,Colour(LOP)
  794.    Next LOP
  795.    Wait Vbl 
  796.    Autoback 0
  797.    Synchro Off : Update Off 
  798.    Wait Vbl 
  799.    '
  800.    Paste Bob 285,238,36
  801.    Paste Bob 218,255,42
  802.    Paste Bob 183,326,37
  803.    Paste Bob 48,288,15
  804.    Paste Bob 48,400,15
  805.    Paste Bob 100,350,15
  806.    '
  807.    Channel 21 To Bob 21
  808.    Bob 21,285+3,234,34
  809.    M$="     Begin: Let X=285+3 ; Let Y=234                       ;"
  810.    M$=M$+"        If RN<60 Jump Begin                              ;"
  811.    M$=M$+"        If Z(120)>0 Jump Begin                           ;"
  812.    M$=M$+"        AUtotest(If BC(21,1,8) Jump Next        ;"
  813.    M$=M$+"        eXit ;   Next: Direct Finish)                    ;"
  814.    M$=M$+"        Let R0=XS(2,RX) ; Let R1=YS(2,RW)+RN             ;"
  815.    M$=M$+"        Move R0-X,R1-Y,Z(10)+10                          ;"
  816.    M$=M$+"Finish: Let X=285+3 ; Let Y=234                        ;"
  817.    M$=M$+"        For R3=1 To Z(10)+5 ; P ; Next R3                ;"
  818.    M$=M$+"        Let RJ=RJ+10                                     ;"
  819.    M$=M$+"        If RN<250 Jump Begin                             ;"
  820.    '
  821.    Amal 21,M$
  822.    For L=22 To 23
  823.       Channel L To Bob L
  824.       Bob L,237,258,34
  825.       M$="     Begin: Let X=227 ; Let Y=258                        ;"
  826.       M$=M$+"        If RN<70 Jump Begin                              ;"
  827.       M$=M$+"        If Z(120)>0 Jump Begin                           ;"
  828.       M$=M$+"        AUtotest(If BC("+Str$(L)+",1,8) Jump Next        ;"
  829.       M$=M$+"        eXit ;   Next: Direct Finish)                    ;"
  830.       M$=M$+"        Let R0=XS(2,RX) ; Let R1=YS(2,RW)+RN             ;"
  831.       M$=M$+"        Move R0-X,R1-Y,Z(10)+10                          ;"
  832.       M$=M$+"Finish: Let X=226 ; Let Y=258                        ;"
  833.       M$=M$+"        For R3=1 To Z(10)+5 ; P ; Next R3                ;"
  834.       M$=M$+"        Let RJ=RJ+10                                     ;"
  835.       M$=M$+"        If RN<250 Jump Begin                             ;"
  836.       '
  837.       Amal L,M$
  838.    Next L
  839.    Channel 24 To Bob 24
  840.    Bob 24,47,289,13
  841.    M$="     Begin: Let X=47 ; Let Y=289                        ;"
  842.    M$=M$+"        If RN<150 Jump Begin                             ;"
  843.    M$=M$+"        If Z(120)>0 Jump Begin                           ;"
  844.    M$=M$+"        AUtotest(If BC(24,1,8) Jump Next                 ;"
  845.    M$=M$+"        eXit ;   Next: Direct Finish)                    ;"
  846.    M$=M$+"        Let R0=XS(2,RX) ; Let R1=YS(2,RW)+RN             ;"
  847.    M$=M$+"        Move R0-X,R1-Y,Z(5)+15                           ;"
  848.    M$=M$+"Finish: Let X=47 ; Let Y=289                         ;"
  849.    M$=M$+"        For R3=1 To Z(10)+5 ; P ; Next R3                ;"
  850.    M$=M$+"        Let RJ=RJ+10                                     ;"
  851.    M$=M$+"        If RN<310 Jump Begin                             ;"
  852.    Amal 24,M$
  853.    '
  854.    '
  855.    '--||-- # Hauptwächter #   
  856.    '--\/-- **************** 
  857.    '
  858.    Channel 25 To Bob 25
  859.    Bob 25,273+4,2000+5,48
  860.    M$="     Begin: Let X=273+4 ; Let Y=2000+5 ; Let R2=15          ;"
  861.    M$=M$+"        Anim 1,(48,300)(49,50)(50,50)(51,50)(52,50)      ;"
  862.    M$=M$+"        If RN<190 Jump Begin                             ;"
  863.    M$=M$+"        If Z(120)>0 Jump Begin                           ;"
  864.    M$=M$+"        AUtotest(If BC(25,1,8) Jump Next                 ;"
  865.    M$=M$+"        eXit ;   Next: Direct Finish)                    ;"
  866.    M$=M$+"K:      Let R0=XS(2,RX) ; Let R1=YS(2,RW)+RN             ;"
  867.    M$=M$+"        Move R0-X+10,R1-Y-10,20                          ;"
  868.    M$=M$+"        For R3=1 To Z(5)+5 ; P ; Next R3                 ;"
  869.    M$=M$+"        Let R2=R2-1 ; Jump K                             ;"
  870.    M$=M$+"Finish: Let X=273+4 ; Let Y=2000+5                       ;"
  871.    M$=M$+"        For R3=1 To Z(10)+5 ; P ; Next R3                ;"
  872.    M$=M$+"        Let RJ=RJ+10                                     ;"
  873.    M$=M$+"        If RN<290 Jump Begin                             ;"
  874.    Amal 25,M$
  875.    '
  876.    For L=26 To 27
  877.       Channel L To Bob L
  878.       Bob L,47,401,13
  879.       M$="     Begin: Let X=47 ; Let Y=401                        ;"
  880.       M$=M$+"        If RN<310 Jump Begin                              ;"
  881.       M$=M$+"        If Z(120)>0 Jump Begin                           ;"
  882.       M$=M$+"        AUtotest(If BC("+Str$(L)+",1,8) Jump Next        ;"
  883.       M$=M$+"        eXit ;   Next: Direct Finish)                    ;"
  884.       M$=M$+"        Let R0=XS(2,RX) ; Let R1=YS(2,RW)+RN             ;"
  885.       M$=M$+"        Move R0-X,R1-Y,Z(10)+10                          ;"
  886.       M$=M$+"Finish: Let X=47 ; Let Y=401                       ;"
  887.       M$=M$+"        For R3=1 To Z(10)+5 ; P ; Next R3                ;"
  888.       M$=M$+"        Let RJ=RJ+10                                     ;"
  889.       M$=M$+"        If RN<430 Jump Begin                             ;"
  890.       '
  891.       Amal L,M$
  892.    Next L
  893.    '
  894.    For L=28 To 29
  895.       Channel L To Bob L
  896.       Bob L,184,337,34
  897.       M$="     Begin: Let X=184; Let Y=337                            ;"
  898.       M$=M$+"        If RN<300 Jump Begin                             ;"
  899.       M$=M$+"        If Z(120)>0 Jump Begin                           ;"
  900.       M$=M$+"        AUtotest(If BC("+Str$(L)+",1,8) Jump Next        ;"
  901.       M$=M$+"        eXit ;   Next: Direct Finish)                    ;"
  902.       M$=M$+"        Let R0=XS(2,RX) ; Let R1=YS(2,RW)+RN             ;"
  903.       M$=M$+"        Move R0-X,R1-Y,Z(10)+10                          ;"
  904.       M$=M$+"Finish: Let X=184 ; Let Y=337                            ;"
  905.       M$=M$+"        For R3=1 To Z(10)+5 ; P ; Next R3                ;"
  906.       M$=M$+"        Let RJ=RJ+10                                     ;"
  907.       M$=M$+"        If RN<400 Jump Begin                             ;"
  908.       '
  909.       Amal L,M$
  910.    Next L
  911.    '
  912.    Reserve Zone 1
  913.    Set Zone 1,250,580 To 320,600+24
  914.    '
  915. End Proc
  916. Procedure VERTICAL_SHIP
  917.    ' ~~~~~    Ship Movement     ~~~~~   
  918.    SHIP$=" Jump Setanim ;"
  919.    '
  920.    ' This line reads the current joystick value into the register R0 and
  921.    ' then puts the X and Y positions of the hardware sprite into the
  922.    ' external registers RX and RW. This allows our basic program and the
  923.    ' other AMAL programs to find out where the ship is on the screen. 
  924.    '
  925.    SHIP$=SHIP$+" Begin:     Let R0=Joy1 ; Let RX=X ; Let RW=Y"
  926.    '
  927.    ' These lines check for collisions, the first deals with bobs. The 
  928.    ' second line looks at the external register RZ (Amreg(25)). If
  929.    ' the value in the register equals one we blow up the ship, the value
  930.    ' stored here is generated by the basic part of the program checking 
  931.    ' collisions with the background graphics. 
  932.    '
  933.    SHIP$=SHIP$+"            If BC(15,20,29) Jump Explode  ;"
  934.    SHIP$=SHIP$+"            If RZ=1 Jump Explode  ;"
  935.    '
  936.    ' These lines make sure the players ship does not leave the screen   
  937.    ' playing area. Remember these numbers are all HARDWARE coordinates. 
  938.    '
  939.    SHIP$=SHIP$+"            If X<140 Jump V     ;"
  940.    SHIP$=SHIP$+"            If X>418 Jump Q     ;"
  941.    SHIP$=SHIP$+"            If Y>160 Jump N     ;"
  942.    SHIP$=SHIP$+"            If Y<60 Jump K      ;"
  943.    '
  944.    ' Now we start to move the ship, depending on the joystick movements.
  945.    ' This line jumps to the label "T" if the joystick is moved AND the
  946.    ' fire button has been pressed.
  947.    '
  948.    SHIP$=SHIP$+"            If R0>16 Jump T     ;"
  949.    '
  950.    ' If the joystick is moved in any direction the program jumps to the 
  951.    ' correct label and moves the ship.  
  952.    ' 1=UP 2=DOWN 4=LEFT 8=RIGHT 5=LEFT+UP 10=RIGHT+DOWN 
  953.    ' 9=RIGHT+UP 6=LEFT+DOWN 
  954.    '
  955.    SHIP$=SHIP$+" Movement:  If R0=1  Jump Up    ;"
  956.    SHIP$=SHIP$+"            If R0=2  Jump Down  ;"
  957.    SHIP$=SHIP$+"            If R0=4  Jump Left  ;"
  958.    SHIP$=SHIP$+"            If R0=8  Jump Right ;"
  959.    SHIP$=SHIP$+"            If R0=5  Jump H     ;"
  960.    SHIP$=SHIP$+"            If R0=10 Jump O     ;"
  961.    SHIP$=SHIP$+"            If R0=9  Jump Y     ;"
  962.    SHIP$=SHIP$+"            If R0=6  Jump G     ;"
  963.    SHIP$=SHIP$+" Checkfire: If R0&16 Jump Fire  ;"
  964.    SHIP$=SHIP$+" Jump Begin                      ;"
  965.    SHIP$=SHIP$+" Tovement:  If R0=17  Jump Up    ;"
  966.    SHIP$=SHIP$+"            If R0=18  Jump Down  ;"
  967.    SHIP$=SHIP$+"            If R0=20  Jump Left  ;"
  968.    SHIP$=SHIP$+"            If R0=24  Jump Right ;"
  969.    SHIP$=SHIP$+"            If R0=21  Jump H     ;"
  970.    SHIP$=SHIP$+"            If R0=26 Jump O     ;"
  971.    SHIP$=SHIP$+"            If R0=25  Jump Y     ;"
  972.    SHIP$=SHIP$+"            If R0=22  Jump G     ;"
  973.    SHIP$=SHIP$+" Jump Begin                     ;"
  974.    SHIP$=SHIP$+" H:     ; Move 0-RK,0-RK,1           ; Jump C         ;"
  975.    SHIP$=SHIP$+" O:     ; Move RK,RK,1               ; Jump C         ;"
  976.    SHIP$=SHIP$+" Y:     ; Move RK,0-RK,1             ; Jump C         ;"
  977.    SHIP$=SHIP$+" G:     ; Move 0-RK,RK,1             ; Jump C         ;"
  978.    SHIP$=SHIP$+" Up:    ; Move 0,0-RK,1              ; Jump C         ;"
  979.    SHIP$=SHIP$+" Down:  ; Move 0,RK,1                ; Jump C         ;"
  980.    SHIP$=SHIP$+" Right: ; Move RK,0,1                ; Jump C         ;"
  981.    SHIP$=SHIP$+" Left:  ; Move 0-RK,0,1              ; Jump C         ;"
  982.    SHIP$=SHIP$+" Setanim: Anim 0,(22,10)(23,10)        ; Jump Begin     ;"
  983.    SHIP$=SHIP$+" Fire: Let RA=1                      ; Jump Begin     ;"
  984.    SHIP$=SHIP$+" V:    Let X=140                     ; Jump Checkfire ;"
  985.    SHIP$=SHIP$+" Q:    Let X=418                     ; Jump Checkfire ;"
  986.    SHIP$=SHIP$+" N:    Let Y=160                     ; Jump Checkfire ;"
  987.    SHIP$=SHIP$+" K:    Let Y=60                      ; Jump Checkfire ;"
  988.    SHIP$=SHIP$+"Explode: Anim 1,(5,1)(6,1)(7,1)(8,1)(9,1)(10,1)(11,1) ;  P P P P P P P P ; Let Y=0 ; P ; Let RY=99 ;"
  989.    '  
  990.    ' Main ship hardware sprite definition 
  991.    '  
  992.    Screen 2
  993.    Channel 15 To Sprite 15
  994.    If FIN_LEVEL=True and LEVEL>1 and X Sprite(15)>0 and Y Sprite(15)>0
  995.       Sprite 15,,,22
  996.    Else 
  997.       If LEVEL=2
  998.          Sprite 15,410,130+50,22
  999.       End If 
  1000.       If LEVEL=4
  1001.          Sprite 15,390,170,22
  1002.       End If 
  1003.       If LEVEL=6
  1004.          Sprite 15,336,170,22
  1005.       End If 
  1006.    End If 
  1007.    Amreg(10)=5
  1008.    Amal 15,SHIP$
  1009.    '
  1010.    '
  1011.    '
  1012.    For L=1 To 8
  1013.       F$(L)="       Begin: Let Y=-50 ; Let A=25 ;                         ;"
  1014.       F$(L)=F$(L)+" If R"+Chr$(65+L)+"=100 Jump Begin                     ;"
  1015.       F$(L)=F$(L)+" Let R"+Chr$(65+L)+"=1                                 ;"
  1016.       F$(L)=F$(L)+" Let X=RX-128 ; Let Y=YS(2,RW)+RN                      ;"
  1017.       F$(L)=F$(L)+" Let R3=RW-50 ; Let R1=160-R3 ; Let R2=R1/18           ;"
  1018.       F$(L)=F$(L)+"       For R0=1 To 7                                   ;"
  1019.       F$(L)=F$(L)+"           Let Y=Y+18                                  ;"
  1020.       F$(L)=F$(L)+"           If BC("+Str$(L)+",20,40) Jump Killed        ;"
  1021.       F$(L)=F$(L)+"       Next R0                                         ;"
  1022.       F$(L)=F$(L)+" Killed: Let R"+Chr$(65+L)+"=2 ; Let X=X-9 ; Let Y=Y+3 ;"
  1023.       F$(L)=F$(L)+" Explode: Anim 1,(5,1)(6,1)(7,1)(8,1)(9,1)(10,1)(11,1) ;"
  1024.       F$(L)=F$(L)+"          P P P P P P P P ; Let Y=-50                        ;"
  1025.       F$(L)=F$(L)+"          Let R"+Chr$(65+L)+"=100 ; Jump Begin         ;"
  1026.    Next L
  1027.    '  
  1028.    ' Vertical missiles (all bobs)   
  1029.    '  
  1030.    Screen 1
  1031.    For LOP=1 To 8
  1032.       Channel LOP To Bob LOP
  1033.    Next LOP
  1034.    For L=1 To 8
  1035.       Bob L,100,-50,25
  1036.       Amal L,F$(L)
  1037.    Next L
  1038.    '
  1039.    '
  1040. End Proc
  1041. Procedure HORIZONTAL_SHIP
  1042.    ' ~~~~~    Ship Movement     ~~~~~   
  1043.    SHIP$=" Jump Setanim ;"
  1044.    '
  1045.    ' This line reads the current joystick value into the register R0 and
  1046.    ' then puts the X and Y positions of the hardware sprite into the
  1047.    ' external registers RX and RW. This allows our basic program and the
  1048.    ' other AMAL programs to find out where the ship is on the screen. 
  1049.    '
  1050.    SHIP$=SHIP$+" Begin:     Let R0=Joy1 ; Let RX=X ; Let RW=Y"
  1051.    '
  1052.    ' These lines check for collisions, the first deals with bobs. The 
  1053.    ' second line looks at the external register RZ (Amreg(25)). If
  1054.    ' the value in the register equals one we blow up the ship, the value
  1055.    ' stored here is generated by the basic part of the program checking 
  1056.    ' collisions with the background graphics. 
  1057.    '
  1058.    SHIP$=SHIP$+"            If BC(15,20,29) Jump Explode  ;"
  1059.    SHIP$=SHIP$+"            If RZ=1 Jump Explode  ;"
  1060.    '
  1061.    ' These lines make sure the players ship does not leave the screen   
  1062.    ' playing area. Remember these numbers are all HARDWARE coordinates. 
  1063.    '
  1064.    SHIP$=SHIP$+"            If X<130 Jump V     ;"
  1065.    SHIP$=SHIP$+"            If X>405 Jump Q     ;"
  1066.    SHIP$=SHIP$+"            If Y>180 Jump N     ;"
  1067.    SHIP$=SHIP$+"            If Y<60 Jump K      ;"
  1068.    '
  1069.    ' Now we start to move the ship, depending on the joystick movements.
  1070.    ' This line jumps to the label "T" if the joystick is moved AND the
  1071.    ' fire button has been pressed.
  1072.    '
  1073.    SHIP$=SHIP$+"            If R0>16 Jump T     ;"
  1074.    '
  1075.    ' If the joystick is moved in any direction the program jumps to the 
  1076.    ' correct label and moves the ship.  
  1077.    ' 1=UP 2=DOWN 4=LEFT 8=RIGHT 5=LEFT+UP 10=RIGHT+DOWN 
  1078.    ' 9=RIGHT+UP 6=LEFT+DOWN 
  1079.    '
  1080.    SHIP$=SHIP$+" Movement:  If R0=1  Jump Up    ;"
  1081.    SHIP$=SHIP$+"            If R0=2  Jump Down  ;"
  1082.    SHIP$=SHIP$+"            If R0=4  Jump Left  ;"
  1083.    SHIP$=SHIP$+"            If R0=8  Jump Right ;"
  1084.    SHIP$=SHIP$+"            If R0=5  Jump H     ;"
  1085.    SHIP$=SHIP$+"            If R0=10 Jump O     ;"
  1086.    SHIP$=SHIP$+"            If R0=9  Jump Y     ;"
  1087.    SHIP$=SHIP$+"            If R0=6  Jump G     ;"
  1088.    SHIP$=SHIP$+" Checkfire: Let RX=X ; Let RW=Y ; If R0&16 Jump Fire  ;"
  1089.    SHIP$=SHIP$+" Jump Begin                      ;"
  1090.    SHIP$=SHIP$+" Tovement:  If R0=17  Jump Up    ;"
  1091.    SHIP$=SHIP$+"            If R0=18  Jump Down  ;"
  1092.    SHIP$=SHIP$+"            If R0=20  Jump Left  ;"
  1093.    SHIP$=SHIP$+"            If R0=24  Jump Right ;"
  1094.    SHIP$=SHIP$+"            If R0=21  Jump H     ;"
  1095.    SHIP$=SHIP$+"            If R0=26 Jump O     ;"
  1096.    SHIP$=SHIP$+"            If R0=25  Jump Y     ;"
  1097.    SHIP$=SHIP$+"            If R0=22  Jump G     ;"
  1098.    SHIP$=SHIP$+" Jump Begin                     ;"
  1099.    '
  1100.    ' These line move the ship in increments governed by the AMAL register 
  1101.    ' RK (amreg(10)).  
  1102.    '
  1103.    SHIP$=SHIP$+" H:     ; Move -5,-5,1           ; Jump C         ;"
  1104.    SHIP$=SHIP$+" O:     ; Move 5,5,1               ; Jump C         ;"
  1105.    SHIP$=SHIP$+" Y:     ; Move 5,-5,1             ; Jump C         ;"
  1106.    SHIP$=SHIP$+" G:     ; Move -5,5,1             ; Jump C         ;"
  1107.    SHIP$=SHIP$+" Up:    ; Move 0,-5,1              ; Jump C         ;"
  1108.    SHIP$=SHIP$+" Down:  ; Move 0,5,1                ; Jump C         ;"
  1109.    SHIP$=SHIP$+" Right: ; Move 5,0,1                ; Jump C         ;"
  1110.    SHIP$=SHIP$+" Left:  ; Move -5,0,1              ; Jump C         ;"
  1111.    SHIP$=SHIP$+" Setanim: Anim 0,(1,10)(2,10); Jump Begin     ;"
  1112.    SHIP$=SHIP$+" Fire: Let RA=1                      ; Jump Begin     ;"
  1113.    SHIP$=SHIP$+" V:    Let X=130                     ; Jump Checkfire ;"
  1114.    SHIP$=SHIP$+" Q:    Let X=405                     ; Jump Checkfire ;"
  1115.    SHIP$=SHIP$+" N:    Let Y=180                     ; Jump Checkfire ;"
  1116.    SHIP$=SHIP$+" K:    Let Y=60                      ; Jump Checkfire ;"
  1117.    SHIP$=SHIP$+"Explode: Anim 1,(5,1)(6,1)(7,1)(8,1)(9,1)(10,1)(11,1) ;  P P P P P P P P ; Let Y=0 ; P ; Let RY=99 ;"
  1118.    '
  1119.    ' Main ship hardware sprite definition 
  1120.    '  
  1121.    Screen 2
  1122.    Channel 15 To Sprite 15
  1123.    If FIN_LEVEL=True and LEVEL>1 and X Sprite(15)>0 and Y Sprite(15)>0
  1124.       Sprite 15,,,1
  1125.    Else 
  1126.       If LEVEL=1
  1127.          Sprite 15,176,124,1
  1128.       End If 
  1129.       If LEVEL=3
  1130.          Sprite 15,120+120,72+50,1
  1131.       End If 
  1132.       If LEVEL=5
  1133.          Sprite 15,128+60,104,1
  1134.       End If 
  1135.       If LEVEL=7
  1136.          Sprite 15,128+60,104,1
  1137.       End If 
  1138.    End If 
  1139.    Amreg(10)=5
  1140.    Amal 15,SHIP$
  1141.    '
  1142.    For L=1 To 8
  1143.       F$(L)="       Begin: Let Y=-50 ; Let A=4                            ;"
  1144.       F$(L)=F$(L)+" If R"+Chr$(65+L)+"=100 Jump Begin                     ;"
  1145.       F$(L)=F$(L)+" Let R"+Chr$(65+L)+"=1                                 ;"
  1146.       F$(L)=F$(L)+" Let X=XS(2,RX)+RN+20  ; Let Y=RW-50+6                    ;"
  1147.       F$(L)=F$(L)+" Let R3=RX-128 ; Let R1=320-R3 ; Let R2=R1/18          ;"
  1148.       F$(L)=F$(L)+"       For R0=1 To 7                                   ;"
  1149.       F$(L)=F$(L)+"           Let X=X+18                                  ;"
  1150.       F$(L)=F$(L)+"           If BC("+Str$(L)+",20,40) Jump Killed        ;"
  1151.       F$(L)=F$(L)+"       Next R0                                         ;"
  1152.       F$(L)=F$(L)+" Killed:  Let R"+Chr$(65+L)+"=2 ; Let Y=Y-4            ;"
  1153.       F$(L)=F$(L)+" Explode: Anim 1,(5,1)(6,1)(7,1)(8,1)(9,1)(10,1)(11,1) ;"
  1154.       F$(L)=F$(L)+"          P P P P P P P P ; Let Y=-50 ; P ;            ;"
  1155.       F$(L)=F$(L)+"          Let R"+Chr$(65+L)+"=100 ; Jump Begin         ;"
  1156.    Next L
  1157.    '
  1158.    Screen 1
  1159.    For LOP=1 To 8
  1160.       Channel LOP To Bob LOP
  1161.    Next LOP
  1162.    '
  1163.    For L=1 To 8
  1164.       Bob L,100,-50,4
  1165.       Amal L,F$(L)
  1166.    Next L
  1167. End Proc
  1168. Procedure HISCORE_DISPLAY
  1169.    '
  1170.    Global SCR_FLG
  1171.    '
  1172.    Dim C(16)
  1173.    '
  1174.    ' Unpack the image into screen 7, and fade it down to black  
  1175.    Load "Hiscorepic",7 : Unpack 7 To 7 : Ink 0 : Bar 0,200 To 320,256 : Screen Hide 
  1176.    For C=0 To 15 : C(C)=Colour(C) : Colour C,0 : Next 
  1177.    '
  1178.    ' This internal flag is set to one if we have to   
  1179.    ' enter the name. In this case, we just copy the 
  1180.    ' ENTER YOUR NAME picture to the title area at the top of the screen 
  1181.    If SCR_FLG
  1182.       Screen Copy 7,82,72,234,123 To 7,82,4
  1183.    End If 
  1184.    '
  1185.    ' Erase 'Enter your name' from the screen area   
  1186.    Cls 0,80,72 To 240,120
  1187.    '
  1188.    ' Display the 10 names using a FOR..NEXT loop  
  1189.    '  
  1190.    Ink 1,0,0
  1191.    For I=0 To 9
  1192.       YP=82+I*9
  1193.       SCORE$=Mid$(Str$(SCORE(I)),2)
  1194.       LS=Text Length(SCORE$)
  1195.       Text 85,YP,NOM$(I)
  1196.       Text 251-LS,YP,SCORE$
  1197.    Next I
  1198.    '
  1199.    ' Now we can fade in the screen
  1200.    Screen Show 
  1201.    '
  1202.    ' Fade the screen back to the original colours 
  1203.    Fade 1,C(0),C(1),C(2),C(3),C(4),C(5),C(6),C(7),C(8),C(9),C(10),C(11),C(12),C(13),C(14),C(15)
  1204.    ' Wait until the fade is over
  1205.    Wait 16
  1206.    '
  1207.    Pop Proc
  1208.    '
  1209. End Proc
  1210. Procedure HISCORE_REMOVE
  1211.    '
  1212.    ' Simply fade out the screen to black, and erase it
  1213.    Fade 1 : Wait 16
  1214.    Screen Close 7
  1215.    '
  1216. End Proc
  1217. Procedure HISCORE_ENTER[SCORE]
  1218.    '
  1219.    Global SCR_FLG
  1220.    '
  1221.    If SCORE>SCORE(9)
  1222.       '
  1223.       ' Find the position of our new score in the table
  1224.       POS=0
  1225.       While SCORE<=SCORE(POS)
  1226.          POS=POS+1
  1227.       Wend 
  1228.       '  Move the lower scores one place down  
  1229.       For I=9 To POS+1 Step -1
  1230.          NOM$(I)=NOM$(I-1)
  1231.          SCORE(I)=SCORE(I-1)
  1232.       Next I
  1233.       NOM$(POS)=""
  1234.       SCORE(POS)=SCORE
  1235.       '
  1236.       ' Display score, with the ENTER YOUR NAME picture along the title
  1237.       SCR_FLG=-1 : HISCORE_DISPLAY
  1238.       '
  1239.       ' Set up Cursor  
  1240.       Flash 15,"(FFF,30)(666,20)"
  1241.       XC=100 : YC=50
  1242.       '
  1243.       ' Display Cursor 
  1244.       Gosub CURSEUR
  1245.       '
  1246.       ' Input the name using a REPEAT..UNTIL loop
  1247.       Repeat 
  1248.          ' Read keyboard  
  1249.          K$=Inkey$
  1250.          K=Asc(K$)
  1251.          L=Len(NOM$)
  1252.          ' Handle Backspace 
  1253.          If K=8 and L>0
  1254.             DC=0
  1255.             XC=XC-8
  1256.             Text XC,YC,"  "
  1257.             Gosub CURSEUR
  1258.             NOM$=Left$(NOM$,L-1)
  1259.          End If 
  1260.          ' Handle cursor  
  1261.          If K>13 and L<15
  1262.             DC=8
  1263.             Ink 1 : Text XC,YC,K$
  1264.             XC=XC+8
  1265.             Gosub CURSEUR
  1266.             NOM$=NOM$+K$
  1267.          End If 
  1268.          '
  1269.          ' Repeat until a carriage return.  
  1270.       Until K=13
  1271.       '
  1272.       ' Put the new name into the NOM$ array 
  1273.       NOM$(POS)=NOM$
  1274.       SCORE(POS)=SCORE
  1275.       '
  1276.       ' Erase screen 
  1277.       Flash Off 
  1278.       HISCORE_REMOVE
  1279.       SCR_FLG=0
  1280.       '
  1281.    End If 
  1282.    '
  1283.    ' Display final array, and return! 
  1284.    HISCORE_DISPLAY
  1285.    '
  1286.    Pop Proc
  1287.    '
  1288.    '  Simulate a 'fake' text cursor using the DRAW command  
  1289.    CURSEUR:
  1290.    Ink 15 : Draw XC,YC+1 To XC+6,YC+1
  1291.    Return 
  1292.    '
  1293. End Proc
  1294. Procedure HISCORE_LOAD[N$]
  1295.    '
  1296.    ' Handle errors
  1297.    On Error Goto ERREUR
  1298.    '
  1299.    ' Open a simple sequential file
  1300.    Open In 1,N$
  1301.    ' Read the names and scores from the disc
  1302.    For I=0 To 9
  1303.       Line Input #1,NOM$(I),SCORE$
  1304.       SCORE(I)=Val(SCORE$)
  1305.    Next I
  1306.    ' Close up the file  
  1307.    Close 1
  1308.    '
  1309.    SKIP:
  1310.    Pop Proc
  1311.    '
  1312.    ERREUR:
  1313.    Resume SKIP
  1314.    '
  1315. End Proc
  1316. Procedure HISCORE_SAVE[N$]
  1317.    '
  1318.    ' Handle errors
  1319.    On Error Goto ERREUR
  1320.    '
  1321.    ' Create a simple sequential file  
  1322.    Open Out 1,N$
  1323.    ' Write the names and scores to the new file 
  1324.    For I=0 To 9
  1325.       Print #1,NOM$(I)
  1326.       Print #1,Str$(SCORE(I))
  1327.    Next I
  1328.    ' Close the file (ESSENTIAL!)
  1329.    Close 1
  1330.    '
  1331.    SKIP:
  1332.    Pop Proc
  1333.    '
  1334.    ERREUR:
  1335.    Resume SKIP
  1336.    '
  1337. End Proc
  1338. Procedure TITELHI
  1339.    '
  1340.    Global SCR_FLG
  1341.    '
  1342.    Dim C(16)
  1343.    '
  1344.    ' Unpack the image into screen 7, and fade it down to black  
  1345.    Rainbow Del : Load "HiscorePic",7 : Unpack 7 To 7 : Screen Hide 
  1346.    For C=0 To 15 : C(C)=Colour(C) : Colour C,0 : Next 
  1347.    '
  1348.    ' This internal flag is set to one if we have to   
  1349.    ' enter the name. In this case, we just copy the 
  1350.    ' ENTER YOUR NAME picture to the title area at the top of the screen 
  1351.    If SCR_FLG
  1352.       Screen Copy 7,82,72,234,123 To 7,82,4
  1353.    End If 
  1354.    '
  1355.    ' Erase 'Enter your name' from the screen area   
  1356.    Cls 0,80,72 To 240,120
  1357.    '
  1358.    ' Display the 10 names using a FOR..NEXT loop  
  1359.    '  
  1360.    Ink 1,0,0
  1361.    For I=0 To 9
  1362.       YP=82+I*9
  1363.       SCORE$=Mid$(Str$(SCORE(I)),2)
  1364.       LS=Text Length(SCORE$)
  1365.       Text 85,YP,NOM$(I)
  1366.       Text 251-LS,YP,SCORE$
  1367.    Next I
  1368.    Rainbow Del 
  1369.    ' Now we can fade in the screen
  1370.    Screen Show 
  1371.    '
  1372.    ' Fade the screen back to the original colours 
  1373.    Fade 1,C(0),C(1),C(2),C(3),C(4),C(5),C(6),C(7),C(8),C(9),C(10),C(11),C(12),C(13),C(14),C(15)
  1374.    ' Wait until the fade is over
  1375.    Wait 16
  1376. While Fire(1)=0 : Wend 
  1377.    Fade 1 : Wait 15 : Screen Close 7
  1378.    
  1379.    
  1380.    
  1381.    Set Rainbow 0,1,280,"","",""
  1382.    Rainbow 0,0,0,280
  1383.    Colour Back 0
  1384.    Restore RDATA
  1385.    For C=0 To 279 : Read CVA : Rain(0,C)=CVA
  1386.    Next C : View 
  1387.    RDATA:
  1388.    Data $A00,$A00,$FFF,$F0F,$0,$A00,$B60,$F00
  1389.    Data $FF0,$C0E,$8F0,$A00,$620,$F,$FF0,$FF0
  1390.    Data $CC,$F,$AF,$B60,$FF0,$F00,$FF0,$F
  1391.    Data $AF,$7C,$F00,$FF,$F,$CC,$D80,$620
  1392.    Data $F00,$AF,$FF,$FF0,$F,$F00,$B60,$FF
  1393.    Data $7C,$FF,$D80,$F00,$7C,$FF,$FF,$F
  1394.    Data $7C,$F,$C0E,$FF0,$C08,$7C,$D80,$F
  1395.    Data $C0E,$0,$FF0,$F0,$8F0,$7C,$F,$F
  1396.    Data $CC,$FF0,$CC,$F0F,$8F0,$C08,$80,$FFF
  1397.    Data $F0,$C08,$7C,$F0F,$F,$C0E,$70F,$AF
  1398.    Data $8F0,$F0,$8F0,$F0,$CC,$F0F,$F,$C08
  1399.    Data $C0E,$AF,$F0,$70F,$F,$F0,$C08,$7C
  1400.    Data $F0F,$7C,$F,$B60,$F00,$CC,$CC,$70F
  1401.    Data $F00,$8F0,$B60,$70F,$C08,$A00,$F00,$70F
  1402.    Data $620,$CC,$620,$FF,$F00,$0,$80,$A00
  1403.    Data $D80,$F00,$FF,$A00,$70F,$80,$B60,$D80
  1404.    Data $F00,$620,$80,$70F,$F00,$FFF,$D80,$A00
  1405.    Data $D80,$620,$D80,$FFF,$AF,$B60,$FFF,$FFF
  1406.    Data $A00,$A00,$D80,$7C,$FF0,$FFF,$B60,$A00
  1407.    Data $FFF,$FF0,$FFF,$D80,$A00,$F0,$F0F,$FFF
  1408.    Data $CC,$AF,$F0F,$AF,$D80,$0,$F0,$C0E
  1409.    Data $0,$C08,$8F0,$8F0,$FF,$0,$0,$B60
  1410.    Data $8F0,$7C,$C08,$F,$8F0,$80,$80,$0
  1411.    Data $80,$CC,$C08,$80,$620,$620,$B60,$620
  1412.    Data $B60,$FFF,$FFF,$B60,$620,$FF,$CC,$0
  1413.    Data $80,$CC,$620,$CC,$620,$CC,$70F,$C08
  1414.    Data $F00,$C08,$C08,$C0E,$C0E,$AF,$C0E,$C08
  1415.    Data $C0E,$AF,$F,$C08,$7C,$AF,$C0E,$CC
  1416.    Data $C0E,$C0E,$7C,$70F,$70F,$D80,$D80,$FF0
  1417.    Data $D80,$A00,$A00,$0,$0,$0,$0,$0
  1418.    Data $0,$0,$0,$0,$0,$0,$0,$0
  1419.    Data $0,$0,$0,$0,$0,$0,$0,$0
  1420.    Data $0,$0,$0,$0,$0,$0,$0,$0
  1421.    Data $0,$0,$0,$0,$0,$0,$0,$0
  1422.    Data $0,$0,$0,$0,$0,$0,$0,$0
  1423.    Data $0,$0,$0,$0,$0,$0,$0,$0
  1424.    '
  1425. End Proc
  1426. Procedure VERT_MAIN_LOOP
  1427.    Repeat 
  1428.       If LEVEL=2
  1429.          LEVEL2
  1430.       End If 
  1431.       If LEVEL=4
  1432.          LEVEL4
  1433.       End If 
  1434.       If LEVEL=6
  1435.          LEVEL6
  1436.       End If 
  1437.       CLEAR_AMAL
  1438.       VERTICAL_SHIP
  1439.       Amal On 
  1440.       '
  1441.       ' Init level variables 
  1442.       '
  1443.       BANG1=0
  1444.       BANG2=0
  1445.       BANG3=0
  1446.       BANG4=0
  1447.       BANG5=0
  1448.       BANG6=0
  1449.       LOP=-1
  1450.       FIN_LEVEL=False
  1451.       '
  1452.       ' Make sure correct screen is showing
  1453.       '
  1454.       Screen 2
  1455.       Get Palette 1
  1456.       Screen To Front 2
  1457.       '
  1458.       ' Start scrolling loop for this level  
  1459.       '
  1460.       Repeat 
  1461.          '
  1462.          ' Increment the area of the background screen to be copied,  
  1463.          ' remembering that the maximum Y position to go to is 480. 
  1464.          ' This value is then put into Amreg(13) which is the AMAL
  1465.          ' register RN. 
  1466.          '
  1467.          Inc LOP
  1468.          LOP=Min(LOP,480)
  1469.          Amreg(13)=LOP
  1470.          
  1471.          '
  1472.          ' We must now make sure the program is "tuned" to the Amiga
  1473.          ' by waiting for the next vertical blank. This is a time 
  1474.          ' when the electron gun of you monitor/TV moves from the bottom
  1475.          ' right hand corner of the screen, to the top left. If we did
  1476.          ' do this a visable flicker would disrupt our screen copied image. 
  1477.          '
  1478.          Wait Vbl 
  1479.          Screen Copy 1,0,LOP,320,LOP+160 To Logic(2),0,0
  1480.          '
  1481.          ' Bitmap collision using POINT command. Because AMOS offers no 
  1482.          ' method to detect collisions between SPRITEs and BOBs, or 
  1483.          ' between SPRITEs and the background landscape I look at 
  1484.          ' six specific around the ship to see if a "foriegn" (eg. not  
  1485.          ' part of the ship) colour is there.     
  1486.          '
  1487.          X=X Screen(1,X Sprite(15))
  1488.          Y=Y Screen(1,Y Sprite(15))
  1489.          BANG1=Point(X,Y)
  1490.          BANG2=Point(X+7,Y+2)
  1491.          BANG3=Point(X+1,Y+4)
  1492.          BANG4=Point(X+7,Y+18)
  1493.          '
  1494.          BANG5=Point(X+2,Y+10)
  1495.          BANG6=Point(X+7,Y+10)
  1496.          '
  1497.          ' If the program detects a collision and we decide to blow up  
  1498.          ' the ship, the AMAL program which controls it must be informed! 
  1499.          ' This is done by passing the value of 1 into the AMAL register
  1500.          ' RZ (or Amreg(25) if you prefer). 
  1501.          '
  1502.          If((BANG1>0 and BANG1<11) or(BANG2>0 and BANG2<11) or(BANG3>0 and BANG3<11) or(BANG4>0 and BANG4<11) or(BANG5>0 and BANG5<11) or(BANG6>0 and BANG6<11)) and CHEAT=0
  1503.             Amreg(25)=1
  1504.             Sam Play 2,2
  1505.          End If 
  1506.          '
  1507.          ' To launch a missile we must first determine if the fire button 
  1508.          ' has been pressed. The ship's AMAL program will put a value of  
  1509.          ' 1 into Amreg(0) (RA) if this event occurs. There are eight 
  1510.          ' missiles, each one has an AMAL register which tells the main 
  1511.          ' program whether it is busy or not, these are Amreg(1) to Amreg(8). 
  1512.          ' If a missile is already in flight its external register will 
  1513.          ' contain the value 100 and the main program will not be able to 
  1514.          ' use it.
  1515.          '
  1516.          If Amreg(0)=1 and Amreg(LAUNCHED)=100 and Fire(1)
  1517.             Amreg(LAUNCHED)=1
  1518.             Amreg(0)=0
  1519.             Sam Play 2,1
  1520.             Amreg(21)=1
  1521.          End If 
  1522.          Add LAUNCHED,1,1 To Amreg(20)
  1523.          '
  1524.          ' These lines allow the program to perform all of its housekeeping   
  1525.          ' and synchronise all of the BOB movements. It also allows us to 
  1526.          ' have more than 16 AMAL channels. 
  1527.          '
  1528.          Synchro 
  1529.          Update 
  1530.          '
  1531.          ' This line is the end of the loop. If the end of level is 
  1532.          ' reached and the player docks the ship OR Amreg(24)=99 we finish.   
  1533.          ' Amreg(24) is set when the AMAL program controlling the ship  
  1534.          ' has finished the animation to blow up the players ship.
  1535.          '
  1536.          Amreg(21)=0
  1537.          Screen 5
  1538.          Paste Bob 0,0,59
  1539.          Ink 2,0 : Text 59,17,Str$(LIVES) : Text 150,17,Str$(LEVEL) : Text 239,17,Str$(SCORE)
  1540.          SCORE=Amreg(9)
  1541.          
  1542.          Screen 2
  1543.       Until(Zone(1,X+4,Y+LOP+10)=1 and LOP>479) or Amreg(24)=99
  1544.       '
  1545.       ' If the level has been completed the players ship must be rotated 
  1546.       ' ready for the next horizontal level! 
  1547.       '
  1548.       If Amreg(24)<>99
  1549.          Amal Off 15
  1550.          Wait 3
  1551.          Screen Copy 1,LOP,0,LOP+320,160 To Logic(2),0,0
  1552.          Synchro 
  1553.          Update 
  1554.          For L=22 To 20 Step -1
  1555.             Wait 3
  1556.             Screen Copy 1,LOP,0,LOP+320,160 To Logic(2),0,0
  1557.             Sprite 15,,,L
  1558.             Synchro 
  1559.             Update 
  1560.             Wait 3
  1561.          Next L
  1562.          Wait 5
  1563.          Screen Copy 1,LOP,0,LOP+320,160 To Logic(2),0,0
  1564.          Sprite 15,,,2
  1565.          Synchro 
  1566.          Update 
  1567.          FIN_LEVEL=True
  1568.       Else 
  1569.          Dec LIVES
  1570.       End If 
  1571.       '
  1572.       ' Finally, if you run out of lives or actually finish the level
  1573.       ' this line ends the large loop and returns control back to the
  1574.       ' main program.
  1575.       '
  1576.    Until LIVES=0 or FIN_LEVEL=True
  1577. End Proc
  1578. Procedure HORIZ_MAIN_LOOP
  1579.    Repeat 
  1580.       If LEVEL=1
  1581.          LEVEL1
  1582.       End If 
  1583.       If LEVEL=3
  1584.          LEVEL3
  1585.       End If 
  1586.       If LEVEL=5
  1587.          LEVEL5
  1588.       End If 
  1589.       CLEAR_AMAL
  1590.       HORIZONTAL_SHIP
  1591.       Amal On 
  1592.       '
  1593.       ' Init level variables 
  1594.       '
  1595.       THUNDER=0
  1596.       BANG1=0
  1597.       BANG2=0
  1598.       BANG3=0
  1599.       BANG4=0
  1600.       BANG5=0
  1601.       BANG6=0
  1602.       LOP=-1
  1603.       FIN_LEVEL=False
  1604.       '
  1605.       ' Make sure correct screen is showing
  1606.       '
  1607.       Screen 2
  1608.       Get Palette 1
  1609.       Screen To Front 2
  1610.       '
  1611.       ' Start scrolling loop for this level  
  1612.       '
  1613.       Repeat 
  1614.          '
  1615.          ' Increment the area of the background screen to be copied,  
  1616.          ' remembering that the maximum X position to go to is 640. 
  1617.          'This value is then put into Amreg(13) which is the AMAL 
  1618.          ' register RN. 
  1619.          '
  1620.          Inc LOP
  1621.          LOP=Min(LOP,640)
  1622.          Amreg(13)=LOP
  1623.          '
  1624.          ' These lines control the thunder and lightning. 
  1625.          ' A random number is first generated, if it is equal to 1  
  1626.          ' I fade the background colour ( which is colour(0) )  
  1627.          ' to bright white ($FFF). When the sample has started to play    
  1628.          ' a value of 1 is put into the variable THUNDER. This is a flag
  1629.          ' which will tell the next part of the program to fade the screen
  1630.          ' background to black again. 
  1631.          '
  1632.          '         If Rnd(200)=1 and Timer>100 and LOP<639
  1633.          '            
  1634.          '            Amreg(21)=1 
  1635.          'ä Fade 1,$F00 
  1636.          '            Timer=0 
  1637.          'ä THUNDER=1 
  1638.          '         End If 
  1639.          '         If THUNDER=1 and Timer>10
  1640.          '            THUNDER=0 
  1641.          '            Fade 1,$0 
  1642.          'ä '            Timer=0' 
  1643.          'ä'         End If 
  1644.          '
  1645.          ' We must now make sure the program is "tuned" to the Amiga
  1646.          ' by waiting for the next vertical blank. This is a time 
  1647.          ' when the electron gun of you monitor/TV moves from the bottom
  1648.          ' right hand corner of the screen, to the top left. If we did
  1649.          ' do this a visable flicker would disrupt our screen copied image. 
  1650.          '
  1651.          Wait Vbl 
  1652.          Screen Copy 1,LOP,0,LOP+320,160 To Logic(2),0,0
  1653.          '
  1654.          ' Bitmap collision using POINT command. Because AMOS offers no 
  1655.          ' method to detect collisions between SPRITEs and BOBs, or 
  1656.          ' between SPRITEs and the background landscape I look at 
  1657.          ' six specific around the ship to see if a "foriegn" (eg. not  
  1658.          ' part of the ship) colour is there.     
  1659.          '
  1660.          X=X Screen(2,X Sprite(15))
  1661.          Y=Y Screen(2,Y Sprite(15))
  1662.          BANG1=Point(X,Y)
  1663.          BANG2=Point(X+14,Y+2)
  1664.          BANG3=Point(X+2,Y+8)
  1665.          BANG4=Point(X+18,Y+8)
  1666.          '
  1667.          BANG5=Point(X+9,Y+2)
  1668.          BANG6=Point(X+9,Y+8)
  1669.          '
  1670.          ' If the program detects a collision and we decide to blow up  
  1671.          ' the ship, the AMAL program which controls it must be informed! 
  1672.          ' This is done by passing the value of 1 into the AMAL register
  1673.          ' RZ (or Amreg(25) if you prefer). 
  1674.          '
  1675.          If((BANG1>0 and BANG1<11) or(BANG2>0 and BANG2<11) or(BANG3>0 and BANG3<11) or(BANG4>0 and BANG4<11) or(BANG5>0 and BANG5<11) or(BANG6>0 and BANG6<11)) and CHEAT=0
  1676.             Amreg(25)=1
  1677.             Sam Play 2,2
  1678.          End If 
  1679.          '
  1680.          ' To launch a missile we must first determine if the fire button 
  1681.          ' has been pressed. The ship's AMAL program will put a value of  
  1682.          ' 1 into Amreg(0) (RA) if this event occurs. There are eight 
  1683.          ' missiles, each one has an AMAL register which tells the main 
  1684.          ' program whether it is busy or not, these are Amreg(1) to Amreg(8). 
  1685.          ' If a missile is already in flight its external register will 
  1686.          ' contain the value 100 and the main program will not be able to 
  1687.          ' use it.
  1688.          '
  1689.          If Amreg(0)=1 and Amreg(LAUNCHED)=100 and Fire(1)
  1690.             Amreg(LAUNCHED)=1
  1691.             Amreg(0)=0
  1692.             Sam Play 2,1
  1693.             Amreg(21)=1
  1694.          End If 
  1695.          Add LAUNCHED,1,1 To Amreg(20)
  1696.          '
  1697.          ' These lines allow the program to perform all of its housekeeping   
  1698.          ' and synchronise all of the BOB movements. It also allows us to 
  1699.          ' have more than 16 AMAL channels. 
  1700.          '
  1701.          Synchro 
  1702.          Update 
  1703.          '
  1704.          ' This line is the end of the loop. If the end of level is 
  1705.          ' reached and the player docks the ship OR Amreg(24)=99 we finish.   
  1706.          ' Amreg(24) is set when the AMAL program controlling the ship  
  1707.          ' has finished the animation to blow up the players ship.
  1708.          '
  1709.          Amreg(21)=0
  1710.          Screen 5
  1711.          SCORE=Amreg(9)
  1712.          Paste Bob 0,0,59
  1713.          Ink 2,0 : Text 59,17,Str$(LIVES) : Text 150,17,Str$(LEVEL) : Text 239,17,Str$(SCORE)
  1714.          Screen 2
  1715.          
  1716.       Until(Zone(1,X+LOP+7,Y+4)=1 and LOP>639) or Amreg(24)=99
  1717.       '
  1718.       ' If the level has been completed the players ship must be rotated 
  1719.       ' ready for the next horizontal level! 
  1720.       '
  1721.       If Amreg(24)<>99
  1722.          If LEVEL<6
  1723.             Amal Off 15
  1724.             Wait 3
  1725.             Screen Copy 1,LOP,0,LOP+320,160 To Logic(2),0,0
  1726.             Synchro 
  1727.             Update 
  1728.             For L=20 To 22
  1729.                Wait 3
  1730.                Screen Copy 1,LOP,0,LOP+320,160 To Logic(2),0,0
  1731.                Sprite 15,,,L
  1732.                Synchro 
  1733.                Update 
  1734.                Wait 3
  1735.             Next L
  1736.          End If 
  1737.          FIN_LEVEL=True
  1738.       Else 
  1739.          Dec LIVES
  1740.       End If 
  1741.       '
  1742.       ' Finally, if you run out of lives or actually finish the level
  1743.       ' this line ends the large loop and returns control back to the
  1744.       ' main program.
  1745.       '
  1746.    Until LIVES=0 or FIN_LEVEL=True
  1747. End Proc
  1748.